package com.ts.test;

import com.gitee.apanlh.util.base.MapUtils;
import com.gitee.apanlh.util.dataformat.JsonUtils;
import com.gitee.apanlh.util.log.Dev;

import java.util.Map;

/**
 * @author Pan
 */
public class OrderDemo {

    public static String getJson(String json) {
        //  排序
        Map<String, Object> map = JsonUtils.toMapOrder(json);
        Map<String, Object> tree = MapUtils.newTreeMap(map);
        return JsonUtils.toJson(tree);
    }

    public static void main(String[] args) {
        String json = "{\"age\":\"35\",\"bizLicenseYear\":\"2\",\"btLimit\":\"2\",\"carInfo\":\"1\",\"career\":\"1\",\"city\":\"\\u5317\\u4eac\\u5e02\",\"creditLimit\":\"1\",\"insurancePolicy\":\"1\",\"loanAmount\":\"1\",\"overdue\":\"1\",\"phoneMd5\":\"78b6e35731846b658797f3acf4e26e2a\",\"providentFund\":\"1\",\"realEstateInfo\":\"1\",\"salaryPayMethod\":\"1\",\"sesameCredit\":\"3\",\"socialSecurity\":\"1\"}";
        Dev.log(getJson(json));
    }
}
